Skip to content

Support income layer runtime controls#176

Merged
Pigbibi merged 2 commits into
mainfrom
codex/income-layer-runtime-overrides-20260618
Jun 18, 2026
Merged

Support income layer runtime controls#176
Pigbibi merged 2 commits into
mainfrom
codex/income-layer-runtime-overrides-20260618

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • allow generic income layer enabled/max-ratio overrides to reach strategy runtime
  • add RUNTIME_TARGET_ENABLED so official runs can be paused per account while dry runs and probes still work
  • sync the new variables to Cloud Run

Tests

  • PYTHONPATH=/tmp/income-check/QuantPlatformKit/src:/tmp/income-check/UsEquityStrategies/src:/tmp/income-check/HkEquityStrategies/src:/tmp/income-check/LongBridgePlatform /tmp/income-check/.venv/bin/python -m pytest -q tests/test_runtime_config_support.py tests/test_strategy_runtime.py

@Pigbibi Pigbibi merged commit 57a66c4 into main Jun 18, 2026
1 check passed
@Pigbibi Pigbibi deleted the codex/income-layer-runtime-overrides-20260618 branch June 18, 2026 14:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 346dac2acf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread strategy_runtime.py Outdated
Comment on lines +169 to +172
if runtime_settings.income_layer_enabled is not None:
overrides["income_layer_enabled"] = runtime_settings.income_layer_enabled
if runtime_settings.income_layer_max_ratio is not None:
overrides["income_layer_max_ratio"] = runtime_settings.income_layer_max_ratio

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate income-layer overrides to compatible profiles

With the pinned UsEquityStrategies runtime used by this repo, the entrypoints merge these overrides into config and call the strategy implementation as **config; soxl_soxx_trend_income.build_rebalance_plan does not accept income_layer_enabled, and tqqq_growth_income.build_rebalance_plan accepts neither of these generic income-layer names. In any environment that sets INCOME_LAYER_ENABLED=false for the semiconductor profile, or sets these generic vars on a TQQQ account, the next evaluation fails with an unexpected-keyword TypeError instead of applying the control. Please only add the keys for profiles whose entrypoints accept them, or update the strategy dependency in the same change.

Useful? React with 👍 / 👎.

Comment thread main.py Outdated
Comment on lines +431 to +433
if not validation_only and not force_run and not RUNTIME_SETTINGS.runtime_target_enabled:
print(f"[{datetime.now()}] Runtime target disabled; skip strategy execution.", flush=True)
return True

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Persist a skipped report for disabled targets

When RUNTIME_TARGET_ENABLED=false on a scheduled /run, this returns before start_run(), finalize_runtime_report(), and persist_execution_report(). The heartbeat workflow still checks due Cloud Run services, and the heartbeat script already treats reports with status skipped as acceptable, so a paused account stops writing any accepted report and is treated as missing after the lookback window. Please record a skipped report/log event before returning.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant